<template>
  <div class="register-page">
    <div class="register-container">
      <div class="register-left">
        <div class="welcome-content">
          <h1>加入我们</h1>
          <p>选择您的角色，开始使用在线考试与题库系统</p>
          <div class="role-info">
            <div class="role-item">
              <el-icon><User /></el-icon>
              <div>
                <h3>学生</h3>
                <p>参加考试、查看个人成绩及错题分析</p>
              </div>
            </div>
            <div class="role-item">
              <el-icon><School /></el-icon>
              <div>
                <h3>教师</h3>
                <p>题库管理、组卷发布、阅卷评分等</p>
              </div>
            </div>
            <div class="role-item">
              <el-icon><Setting /></el-icon>
              <div>
                <h3>管理员</h3>
                <p>系统管理，用户权限控制</p>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="register-right">
        <div class="register-form-container">
          <div class="register-header">
            <h2>用户注册</h2>
            <p>请填写您的注册信息</p>
          </div>
          <register-form></register-form>
          <div class="register-footer">
            <p>已有账号？ <el-link type="primary" @click="$router.push('/login')">立即登录</el-link></p>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import RegisterForm from '@/components/Auth/Register.vue'
import { User, School, Setting } from '@element-plus/icons-vue'

export default {
  name: 'RegisterPage',
  components: {
    RegisterForm,
    User,
    School,
    Setting
  }
}
</script>

<style scoped>
.register-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.register-container {
  display: flex;
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  max-width: 1000px;
  width: 100%;
  min-height: 700px;
}

.register-left {
  flex: 1;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 60px 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.welcome-content h1 {
  font-size: 2.5rem;
  margin-bottom: 20px;
  font-weight: 600;
}

.welcome-content p {
  font-size: 1.1rem;
  margin-bottom: 40px;
  opacity: 0.9;
  line-height: 1.6;
}

.role-info {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.role-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  backdrop-filter: blur(10px);
}

.role-item .el-icon {
  font-size: 2rem;
  color: #ffd04b;
}

.role-item h3 {
  margin: 0 0 5px 0;
  font-size: 1.2rem;
}

.role-item p {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.8;
}

.register-right {
  flex: 1;
  padding: 60px 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.register-form-container {
  width: 100%;
  max-width: 450px;
}

.register-header {
  text-align: center;
  margin-bottom: 40px;
}

.register-header h2 {
  font-size: 2rem;
  color: #2c3e50;
  margin-bottom: 10px;
  font-weight: 600;
}

.register-header p {
  color: #7f8c8d;
  font-size: 1rem;
}

.register-footer {
  text-align: center;
  margin-top: 30px;
  color: #7f8c8d;
}

@media (max-width: 768px) {
  .register-container {
    flex-direction: column;
    max-width: 450px;
  }
  
  .register-left {
    padding: 40px 20px;
  }
  
  .register-right {
    padding: 40px 20px;
  }
  
  .welcome-content h1 {
    font-size: 2rem;
  }
}
</style> 